package com.n5x.model.goods;

public class GoodsGroup {

    private GoodsGroup() {
    }

    public GoodsGroup(Enum<GoodsGroup.GoodsTypeGroupName> goodsTypeGroupName, GoodsInfo goodsInfo) {
        this.name = goodsTypeGroupName.name();
        this.fkGoodsInfo = goodsInfo.getId();
    }

    public enum GoodsTypeGroupName {
        滚屏图片推荐, 优惠商品推荐;

        public static GoodsTypeGroupName getGoodsTypeGroupName(Integer ordinal) {
            if (ordinal == null) return null;
            int size = GoodsTypeGroupName.values().length;
            if (ordinal < 0 || ordinal > size - 1) return null;
            return GoodsTypeGroupName.values()[ordinal];
        }
    }

    private String id;

    /**
     * 商品分组名称
     */
    private String name;

    /**
     * 关联商品信息
     */
    private String fkGoodsInfo;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFkGoodsInfo() {
        return fkGoodsInfo;
    }

    public void setFkGoodsInfo(String fkGoodsInfo) {
        this.fkGoodsInfo = fkGoodsInfo;
    }
}